package com.info33.platform.business.app.controller;

import com.info33.platform.business.app.dto.AppMenuFastDTO;
import com.info33.platform.common.mvc.controller.BaseController;
import com.info33.platform.business.app.entity.AppMenuFast;
import com.info33.platform.business.app.service.AppMenuFastService;
import com.info33.platform.common.mvc.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author admin
 */
@RestController
@RequestMapping("/AppMenuFast")
@Api(tags = "app - 菜单 - 快捷")
public class AppMenuFastController extends BaseController<AppMenuFastService, AppMenuFast> {

    private final AppMenuFastService appMenuFastService;

    @Autowired
    public AppMenuFastController(AppMenuFastService appMenuFastService) {
        super(appMenuFastService);
        this.appMenuFastService = appMenuFastService;
    }

    @PostMapping(value = "/app/change")
    @ApiOperation(value = "app - 更新常用菜单")
    public Result<Object> appChange(
            @Validated(value = AppMenuFastDTO.AppChange.class) @RequestBody AppMenuFastDTO dto) {
        return appMenuFastService.appChange(dto, getCurrentUser());
    }

}